#include<bits/stdc++.h>

using namespace std;
const int maxn = 1e6 + 500;
bool dp[maxn];


void init(int n) {
    for (int i = 0; i <= n; i++)dp[i] = true;
    dp[0] = dp[1] = false;
    for (int i = 2; i <= n / i; i++) {
        if (dp[i]) {
            for (int j = 2 * i; j <= n; j += i) {
                dp[j] = false;
            }
        }
    }
}

int main() {
    int n;
    cin >> n;
    init(n);
    int tot = 0;
    if (n >= 3)++tot;
    for (int i = 3; i + 2 <= n; i += 2) {
        if (dp[i] && dp[i + 2])
            ++tot;
    }
    cout << tot << endl;

    return 0;
}